package com.qf.game;

public class IceBall extends Magic{
    private int count;

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }
    @Override
    public int dealmagicDamage(Master hero) {
        if(count == 10){
            int currentGrade = getGrade();
            setGrade(currentGrade+1);
            System.out.println("技能升级，当前技能等级"+getGrade());
            count = 0;
        }
        if (getGrade()==2){
            System.out.println("冰球术升级为冰雹术");
            BigIceBall bigIceBall = new BigIceBall("冰雹术",1,200);
            hero.setMagic(bigIceBall);
            int damage = bigIceBall.dealmagicDamage();
            return damage;
        }
        int magicDamage = getMagicDamage();
        int totalDamage = (magicDamage+ hero.getWisdom()) * getGrade();
        count++;
        return totalDamage;
    }
}
